The present invention relates generally to the field of computer programming and, more particularly, to compressing computer programs so as to conserve memory resources.
Computer program size for certain embedded applications appears to be growing at a rapid pace. For example, mobile terminals supporting Phase One of the Global System for Mobile Communications (GSM) protocol typically use approximately 32k bytes of digital signal processor (DSP) memory. Current expectations are that mobile terminals supporting the third generation (3G) GSM protocol may require more than 500k bytes of DSP memory. As more features and enhanced functionality are targeted for embedded applications, program size may continue to increase resulting in a corresponding increase in memory usage. The increased memory usage may become a more important factor in both the size and cost of embedded systems.
One approach to conserving memory resources is to design processors with variable length instruction sets. In these architectures, instructions that are more frequently used may be assigned to shorter instructions. Unfortunately, this approach is not application specific, but instead is based on general assumptions of instruction usage. As a result, in certain types of applications, the shortest instructions may not necessarily be used more frequently than the longer instructions.
Another approach to conserving memory resources is to apply a coding algorithm to each instruction in a computer program to achieve a desired level of program compression. One disadvantage to this approach, however, is that an extra step is added during execution of the program to decompress each instruction first before it is executed. Accordingly, execution speed and efficiency may be diminished to reduce memory consumption.
Consequently, there remains a need for improved methods and systems for compressing computer programs and executing these compressed programs.